Skip to content

feat(ui): New Package offers 「同时创建应用」 / Also create an app, ticked by default - #37338

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-37134-create-package-also-app
Nov 25, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-37134-create-package-also-app

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #37134
Clause-②: no
Metadata-protocol: none

维护者速读

  • 在设置的「软件包」页点「新建软件包」,或从「添加应用」菜单、首页等「新建空白应用」入口进到同一个对话框时,名称下面多了一个勾选项「同时创建应用」,默认勾上;勾上时一次确定就同时建好软件包和同名应用,进到 Studio 左上角显示应用名;取消勾选就和以前一样只建软件包。
  • 这是 Studio 重构专题的一步:去掉 Studio 首页以后,原来首页上一步建好包和应用的入口没了,这个勾选项把它补回到唯一的新建软件包对话框里。
  • 如果应用的名字已被别的应用占用,什么都不会写入,对话框直接说明是哪个应用占用了,可以到「高级」里改命名空间或取消勾选;软件包建好但应用没能上线时会弹提示。只改界面,不改服务器和数据,可以直接撤回。
  • 无。

What changes

Tests

  • PackageFormDialog.newAppStep-36748.test.tsx (the shared harness: real dialog, real newAppStep, real metadata client and StudioDesignSurface over a stateful fetch stub). New top-level describes, all mounting the real CreatePackageDialog:
  • PackagesPage.installedAppsUpdates-34722.test.tsx: the page's dialog stand-in now reports whether it was handed the step; three cases pin it for the admin face's button, the ?new=package door and the development face's button.
Ablations — each one red, then restored by hash

Mutations through scripts/ablation-replace.mjs (anchor must hit, on-disk counts printed), restored with git checkout HEAD -- PATH and checked by blob hash and an empty git diff HEAD. app-shell's tests import the dialog and the page by relative path, so no dist/ is in the resolution path.

# Mutation Red
A1 appStep always undefined (ticked creates no app) 4: both "ticked" cases and both "taken" cases
A2 appStep ignores the box 2: "unticked" and the taken-then-untick case
A3 the taken arm never fires 2: both "taken" cases
A4 the box resets to unticked on open 8: every case that reads the default
A5 CreatePackageDialog passes newApp={undefined} 9: the three PackagesPage door cases, every CreatePackageDialog case, the wrapper source pin
A6 ResourceListPage mounts PackageFormDialog mode="create" itself 2: both door source pins

A5's first attempt used an empty replacement, which the tool refused (nothing landed); it was re-run with newApp={undefined}. All six restore lines matched the HEAD blob.

Acceptance notes

Verification

Two-minute check: pnpm dev, open Setup → Packages, New Package, type a name, keep 「同时创建应用」 ticked, Create. Expected: the toast "Created package “NAME” and its app.", then Studio on the new package with 「‹ Back to app · NAME」 in the header. Repeat unticked: the package toast, and the header shows the package name.

Read first: PackageFormDialog.tsx (the appStep line in submit() and the checkbox in the Basics card), PackagesPage.tsx (CreatePackageDialog), then the new describes at the end of PackageFormDialog.newAppStep-36748.test.tsx.

Local runs (head 97fa2d8)

All at head 97fa2d83 unless noted; exit codes captured before any pipe.

  • vitest, PackageFormDialog.newAppStep-36748: Test Files 1 passed (1), Tests 11 passed (11); lock VERDICT command-exit 0.
  • vitest, PackageFormDialog*, PackagesPage.installedAppsUpdates-34722, CreatePackageDialog* (at 4179e152, test-only rename since): Test Files 17 passed (17), Tests 195 passed; then PackagesPage*, ResourceListPage*, EditPackageDialog*, StudioDesignSurface.createApp*: Test Files 36 passed (36), Tests 313 passed (313).
  • pnpm --filter @object-ui/app-shell type-check (src + tsconfig.test.json), after building the @object-ui/app-shell^... closure: lock VERDICT command-exit 0, 0 TS errors.
  • eslint --no-inline-config on the six touched source files: exit 0 (warnings only, all pre-existing lines).
  • pnpm --dir ui exec vitest run scripts/: Test Files 172 passed, 2 skipped (174); Tests 5130 passed. The first run on 28a9d57a failed check-test-path-roots on the new test (a local named path read as the fetch stub's URL path); fixed by the rename in 97fa2d83.
  • check:test-source-alias exit 0 · check:i18n-keys exit 0 · scripts/pm/overlap-check.mjs VERDICT clean exit 0 (merges cleanly with main and feat(studio): author context packs (ai_context) in Studio — a form, and a related-lists block scoped to each child #37315, which shares the two studio catalogues).
  • dispatch-gates.mjs --commands: 39 derived families, all run at 97fa2d83, all exit 0; --ran reconciliation: 39 derived, 39 run, 0 NOT-MEASURED (a derived zero: every row carries its exit code).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ

席位核对 — ACCEPT · L1 · head 97fa2d8386f3e440910b6eb357e8d93876e2f2fd · 2026-11-25T19:59Z

Reviewed against GitHub and the committed tree at this head, not against report 7171588755.

Shape. l1-face.mjs --pr 37338 reads CLEAN: 13 items, none flagged. The PR is open, draft, and based on main. The first line is Fixes #37134, and no closing keyword sits near another card. There is no content/docs/releases/ path and no +0/-0 file. The size is +365/−80 over 7 files. No path is governed (.changeset/**, ui/packages/app-shell/src/**, ui/packages/i18n/src/**), so this is Tier S. Fixes is right: the diff delivers all of Expected 1, 2 and 4. Expected 3 was overtaken when #36908 landed first and removed the landing door.

Card fit and reach. In create mode with a step, PackageFormDialog draws 「同时创建应用」 / "Also create an app". useState(true) sets it, and so does setAlsoApp(true) in the open effect, so it is ticked on every opening. Submitting runs appStep = offersApp && alsoApp ? newApp : undefined. Ticked, that is the #36748 reserve → package POST → app draft → publish path, unchanged. Unticked, it sends the package POST alone. CreatePackageDialog now passes newAppStep(client, locale).

  • At head, git grep CreatePackageDialog (non-test) finds two mounts, PackagesPage.tsx:2463 and ResourceListPage.tsx:1243.
  • Every other PackageFormDialog mount is mode="edit" or mode="view": PackagesPage.tsx:705, PackagesPage.tsx:1559 and inspectors/ObjectPicker.tsx:712.
  • Outside the dialog, ui/** has no other package-create path.
  • The console's 「新建空白应用」 doors reach the dialog through useNewPackageDoorPath → Setup ?new=package.

So the default-on box reaches every create-mode door that remains.

Premise drift. Confirmed at head. studio-design/PackageSwitcher.tsx now exports only PACKAGE_LIST_TOAST_ID, and its header names #36501 as the commit that removed the top-bar switcher. The card's 「Studio package switcher」 call site no longer exists.

Declarations and changeset. I ran readClause2Line and readMetadataProtocolLine (scripts/pm/clause2-line.mjs) on three texts:

Text Clause-② Metadata-protocol
The card's newest Claim: (7169203072) declared no, arm null declared none
The PR body declared no, arm null declared none
.changeset/37134-create-package-also-app.md declared no, arm null declared none

All three read the same.

no is right. The three new keys go into the studio namespace, which is typed Record<string, string> and exported as StudioCatalogue = Readonly<Record<string, string>>. No published type gains a member, which is the card's own Expected 4 criterion. PackageFormDialog's prop types are unchanged; the removed withAppDoorWording and APP_DOOR_HELP_ROWS were module-private. @object-ui/app-shell is private: true.

none is right: nothing a metadata author writes changes. So patch for @object-ui/app-shell and @object-ui/i18n is the right level.

I read the changeset sentence by sentence against the diff:

  • The three doors.
  • "ticked each time the dialog opens".
  • The en and zh toast strings, which match createdWithApp byte for byte.
  • The taken-identifier refusal, which matches newApp.nameTaken and writes nothing.
  • The appFailed toast.
  • "Unticked: only the package is created".
  • "Where the dialog takes you afterwards is unchanged".
  • The three key names, and "No key is removed".
  • "no other props or exports change".

All hold.

Translation keys. node ui/packages/i18n/scripts/released-keys-removed.mjs --tag @object-ui/i18n@18.6.0 lists 77 keys at --ref 97fa2d83, 77 at the merge-base fbb62e1c and 77 at origin/main a182fbe3. A sorted diff of head against the merge-base is empty, so this PR removes no released key. The 77 are pre-existing.

The three new keys (engine.packages.create.alsoApp, alsoAppHint, createdWithApp) are in both studio catalogues, en and zh. "All 11 packs" does not apply here. studio is a two-catalogue key space by ruling (#25922): every other language falls back to en, and its index.ts puts it outside the 11-pack parity suite "by construction … ⛔ must never be given" an exemption. The merged tree from git merge-tree against a182fbe3, which includes #37315's edits to the same two catalogues, has no duplicate key lines in either catalogue.

Pins and ablations. I ran these in a throwaway worktree at head, with the @objectstack/* closure built (OS_SKIP_DTS=1). The worktree has since been removed.

  • pnpm exec vitest run on PackageFormDialog.newAppStep-36748.test.tsx and PackagesPage.installedAppsUpdates-34722.test.tsx: Test Files 2 passed, Tests 54 passed, exit 0. The first file has 11 cases, matching the body.
  • A5 re-run: CreatePackageDialog passes newApp={undefined}. Result: 9 failed, 45 passed. The red cases are both "ticked on every opening" cases, the three ticked/unticked/taken cases, the wrapper source pin, and the three PackagesPage door cases (New Package button, ?new=package, development face). That matches the report's 9.
  • A2 re-run: appStep = offersApp ? newApp : undefined, which ignores the box. Result: 2 failed, "unticked: only the package…" and "ticked, an app name already taken…; unticked, the package goes through". That matches the report's 2.
  • Both restores were checked by blob hash (eca3c854…, 4ff26da7…) against the HEAD blob, with an empty git diff HEAD.

Gates. The check-runs at 97fa2d83 are 58: 45 success, 13 skipped, 0 failed, 0 pending. l1-face counts the 13 as expected skips, with 0 unexpected. Lint & Repo Gates and TypeScript Type Check are both success. Test Core is skipped by design on a ui-only head.

git merge-tree --write-tree origin/main(a182fbe3) 97fa2d83 merges cleanly (tree 4fc1d786). mergeable_state is clean.

K = 10. landing-k.mjs --pr 37338 cannot answer: green run 45676342084 ran no Test Core shard, so it printed no Affected-set diff base. K is therefore read as the first-parent count from the merge-base fbb62e1c to origin/main a182fbe3, which is 10. The legs:

  • Locale leg: since the base, main has added no locale pack. Every translations/ and locales/ change on main is a modification, not an addition.
  • Label leg: this PR changes no translations/ bundle.
  • Shared-budget leg: this PR does not touch ui/**/locales/en.ts.

Accepted deviations. These are the zone's rulings in 7172708246 (2026-11-25T19:44Z):

  • Q1 A: the unread engine.studio.newApp.* rows stay, and one retirement card follows after landing.
  • Q2 A: the submit label stays "Create package" / 「创建软件包」.

Card Expected 3 was overtaken by #36908's earlier landing.

Out of scope. A Studio-only author who cannot open Setup → Packages still has no New Package door. That goes to #37139, as the body's Acceptance notes and 7172708246 record. useNewPackageDoorPath confirms this: such an author's doors lead to Studio's "All metadata", not to the dialog.

Skills-docs: is not owed (kind none, no narrowing arm). No contract review is owed. The diff touches none of the four faces: the declaration is Clause-②: no with no narrowing arm, there is no packages/spec/src/** path, and there is no governed path. reviewFace reports empty hits.schema and empty hits.rules.

维护者速读. It is accurate and follows the four-line form:

  1. Who and where: Setup's 「软件包」 page and the 「新建空白应用」 doors that reach the same dialog.
  2. The Studio redesign topic.
  3. A taken name writes nothing, and the PR is UI-only and can be reverted.
  4. 「无」.

It contains no code names, paths, commands, ruling letters or bare card numbers.

Findings

  • N1 — This diff also leaves engine.studio.newApp.created with no reader. Its only reader was the success toast at the base's PackageFormDialog.tsx:690, and head replaces it with engine.packages.create.createdWithApp; a grep at head finds 0 non-catalogue readers. Neither the PR body's Acceptance notes list nor the Q1 list in 7172708246 names it. The en catalogue comment is accurate ("the app-worded rows have no reader since"). Seat-side: the retirement card the zone files after landing should list created beside title, description, advancedHint, id, help.*, nsDerived, exists and failed. No change to this PR is needed.
  • N2 — The door source pin matches <PackageFormDialog\b[^>]*>, which stops at the first >, including the one inside an arrow =>. It only classifies a mount by mode="edit|view" when mode comes before any arrow-function prop. At head, every mount puts mode first, so the pin reads correctly. This is a fragility to keep in mind if a mount is reordered, not a defect.

No must-fix, no should-fix.

  • Landing: the zone lands it as Tier S. K = 10 (< 15, every leg clear), so there is no merge of main first. Re-read the checks and mergeable_state at 97fa2d83 right before arming.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-justin · session_01QSeKYkkwuF6UuFtu85Yd5H

Landing · 2026-11-25T20:00Z · head 97fa2d83 · zone a4-S (#37134)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants